/**
 * test模块接口列表
 */

import base from './base'; // 导入接口域名列表
import axios from 'request/http'; // 导入http中创建的axios实例
import qs from 'qs'; // 根据需求是否导入qs模块


const music = {
  // banner
  getBanner () {
    return axios.get(`${base.wangYi}/banner`)
  },
  getHotSing () {
    return axios.get(`${base.wangYi}/top/artists?offset=0&limit=80`)
  },
  _getSingerDetail (id) {
    return axios.get(`${base.wangYi}/artists?id=${id}`)
  },
  // 热门歌曲推荐
  _getDiscList () {
    return axios.get(`${base.wangYi}/top/playlist/highquality?before=1503639064232&limit=6`)
  },
  // 榜单内容摘要
  _getRankList () {
    return axios.get(`${base.wangYi}/toplist/detail`)
  },
  // 热搜列表
  _getHot (_this) {
    return axios.get(`${base.wangYi}/search/hot`).then(res => {
      _this.hot = res.data.result.hots
    })
  },
  search (keywords, offset, limit) {
    return axios.get(`${base.wangYi}/search?keywords=${keywords}&offset=${offset}&limit=${limit}`)
  },
  // 音乐是否可用
  checkMusic (id) {
    return axios.get(`${base.wangYi}/check/music?id=${id}`)
  },
  //获取音乐 url
  getSongUrl (id) {
    return axios.get(`${base.wangYi}/song/url?id=${id}`)
  },
  // 获取歌单详情
  getPlayListDetail (id) {
    return axios.get(`${base.wangYi}/playlist/detail?id=${id}`)
  },
  // 获取歌区详情
  getMusicDetail (id) {
    return axios.get(`${base.wangYi}/song/detail?ids=${id}`)
  },
  // 获取歌词
  getMusicLyric (id) {
    return axios.get(`${base.wangYi}/lyric?id=${id}`)
  },
}

export default music
